home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 13 / MacFormat n. 13 (Spain) / Macformat 13.bin / Shareware Internet / Desarrolladores / ICAppSourceKit1.2 / InternetConfig.p < prev    next >
Encoding:
Text File  |  1995-11-07  |  1.5 KB  |  65 lines

  1. program InternetConfig;
  2.  
  3.     uses
  4.         SegLoad, RequiredEventSupport,{}
  5.         ICGlobals, ICDocument, ICEvents, ICWindows, ICInstall, ICIconSuites, ICMiscSubs, ICEditPrefAppleEvents, ICInitialization;
  6.  
  7.     procedure HandleAppParams;
  8.         var
  9.             ap_file: AppFile;
  10.             fss: FSSpec;
  11.             msg, count: integer;
  12.             junk: OSErr;
  13.             junklong: longint;
  14.     begin
  15.         if has_AppleEvents then begin
  16.             junk := InitAppleEvents(@DoOpenApp, @DoOpenDoc, nil, @DoQuit);
  17.         end else begin
  18.             CountAppFiles(msg, count);
  19.             if count <= 0 then begin
  20.                 DisplayError(acNewDocument, DoOpenApp);
  21.             end else begin
  22.                 GetAppFiles(1, ap_file);
  23.                 ClrAppFiles(1);
  24.                 if GetWDInfo(ap_file.vRefNum, fss.vRefNum, fss.parID, junklong) = noErr then begin
  25.                     fss.name := ap_file.fName;
  26.                     DisplayError(acOpenDocument, DoOpenDoc(fss));
  27.                 end; (* if *)
  28.             end; (* if *)
  29.         end; (* if *)
  30.     end; (* HandleAppParams *)
  31.  
  32.     var
  33.         mbar: Handle;
  34.         err: OSErr;
  35. begin
  36.     Initialization;
  37.     mbar := GetNewMBar(128);
  38.     if mbar = nil then begin
  39.         ExitToShell;
  40.     end; (* if *)
  41.     SetMenuBar(mbar);
  42.     AppendResMenu(GetMenuHandle(M_Apple), 'DRVR');
  43.     DrawMenuBar;
  44.     InitGlobals;
  45.     InitMiscSubs;
  46.     InitICIconSuites;
  47.     err := InitICWindows;
  48.     if err = noErr then begin
  49.         err := InitializeComponentInstallation;
  50.     end; (* if *)
  51.     if err = noErr then begin
  52.         err := InitICDocument;
  53.     end; (* if *)
  54.     if err <> noErr then begin
  55.         DisplayError(acStartApplication, err);
  56.         ExitToShell;
  57.     end; (* if *)
  58.     HandleAppParams;
  59.     SetupEditPrefAppleEvent;
  60.     InitCursor;
  61.     while not quitnow do begin
  62.         HandleEvents;
  63.     end; (* while *)
  64.     TermICDocument;
  65. end. (* InternetConfig *)